//
//  BridgeHelper.swift
//  DF_Student
//
//  Created by 刘盖 on 2023/12/11.
//  Copyright © 2023 DFJGED. All rights reserved.
//

import UIKit

@objcMembers public final class BridgeHelper: NSObject {
    
    @objc
    static func size_string(_ str: NSString?, attr: [NSAttributedString.Key : Any]?, size: CGSize) -> CGSize {
        return .size_string(str, attr: attr, size: size)
    }
    
    
}

@objc
public extension BridgeHelper {
    @objc
    static var isIPad: Bool {
        get {
            return Bool.isIPad
        }
    }
    
    @objc
    static var isIPhone: Bool {
        return Bool.isIPhone
    }
    
    @objc
    static var isIPhoneX: Bool {
        return Bool.isIPhoneX
    }
}

@objc
public extension BridgeHelper {
    @objc
    static var screen_width: CGFloat {
        return .screen_width
    }

    @objc
    static var screen_height: CGFloat {
        return .screen_height
    }
  
    @objc
    static var status_bar_height: CGFloat {
        return .status_bar_height
    }
    
    @objc
    static var nav_bar_height: CGFloat {
        return .nav_bar_height
    }
    
    @objc
    static var bottom_safe_height: CGFloat {
        return .bottom_safe_height
    }
  
    //iPhone设计比例基数 宽度375，  iPad设计比例基数 宽度800
    @objc
    static var phone_ratio_base: CGFloat {
        return .phone_ratio_base
    }
    
    @objc
    static var pad_ratio_base: CGFloat {
        return .pad_ratio_base
    }

    @objc
    static var ratio_phone: CGFloat {
        return .ratio_phone
    }
    
    @objc
    static var ratio_pad: CGFloat {
        return .ratio_pad
    }
    
    //比例，由于担心横屏情况下，宽度太宽，使得比例不协调，所以以375为基准，当前屏幕宽、高谁小取谁，来计算比例
    //这个值不会变，因为永远只取宽高中小的一方，不受横竖屏变化影响，也就是横屏的时候会取高度，竖屏会取宽度
    @objc
    static var ratio: CGFloat {
        return .ratio
    }
    
    @objc
    static var ratio_x: CGFloat {
        return .ratio_x
    }
    
    @objc
    static var ratio_y: CGFloat {
        return .ratio_y
    }
    
    //最小值为1的屏幕比例
    @objc
    static var ratio_min_1: CGFloat {
        return .ratio_min_1
    }

    //计算比例后的距离
    @objc
    static let ratioSize: (_ size: CGFloat) -> CGFloat = { size in
        return .ratioSize(size)
    }
    
    @objc
    static var tab_bar_height: CGFloat {
        return .tab_bar_height
    }
    
    @objc
    static var standard_top_height: CGFloat {
        return .standard_top_height
    }
    
    @objc
    static var adapter_nav_height: CGFloat {
        return .adapter_nav_height
    }
    
    @objc
    static var adapter_tool_height: CGFloat {
        return .adapter_tool_height
    }
    
    @objc
    static var adapter_top_height: CGFloat {
        return .adapter_top_height
    }
    
    @objc
    static var adapter_bottom_height: CGFloat {
        return .adapter_bottom_height
    }
    
    // 这个通常用来作为顶部、底部、中间等bar的比例计算
    @objc
    static var ratio_adapter_bar: CGFloat {
        return .ratio_adapter_bar
    }
    
}


@objc
public extension BridgeHelper {
    
}
